name: macOS Tests

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  release:
    types: [published]

jobs:
  macostests:
    name: macOS
    strategy:
      matrix:
        group: [integrity, python, usage, usage2]
        python-version: [3.11]
      fail-fast: false
    timeout-minutes: 45
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Base Setup
        uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

      - name: Setup firefox
        uses: browser-actions/setup-firefox@latest

      - name: Install dependencies
        env:
          GROUP: ${{ matrix.group }}
        run: |
          bash ./scripts/ci_install.sh

      - name: Run test ${{ matrix.group }}
        env:
          GROUP: ${{ matrix.group }}
          JLAB_BROWSER_TYPE: webkit
        run: |
          bash ./scripts/ci_script.sh
